package cn.edu.scau.cmi.hekaimin.Hibernate.controller;

import java.net.URL;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.fxml.JavaFXBuilderFactory;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class RootFX extends Application {
    
	public RootFX() {
		Stage stage = new Stage();
		try {
			start(stage);
		}catch(Exception e) {
			e.printStackTrace();
		}
	}
	@Override
	public void start(Stage primaryStage) throws Exception {
		// TODO Auto-generated method stub

		try {       
            URL location = getClass().getResource("../controller/RootFX.fxml");
			FXMLLoader fxmlLoader = new FXMLLoader();
	        fxmlLoader.setLocation(location);
	        fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
	        Parent root = fxmlLoader.load();
			Scene scene = new Scene(root);
			scene.getStylesheets().add(getClass().getResource("../controller/application.css").toExternalForm());
			primaryStage.setScene(scene);
	        RootFXController controller = fxmlLoader.getController();
	        controller.init();
			primaryStage.setResizable(false);//设置不能窗口改变大小
			primaryStage.setTitle("管理员窗口");//设置标题
			primaryStage.show();
        } catch(Exception e) {
            e.printStackTrace();
        }
	}
	public static void main(String[] args) {
		launch(args);
	}
}
